package com.hhkj.admin.sale.controller;

import com.hhkj.admin.sale.common.cont.SaleCommissionConst;
import com.hhkj.admin.sale.common.cont.SaleWithdrawalConst;
import com.hhkj.admin.sale.domain.SaleWithdrawal;
import com.hhkj.admin.sale.model.req.SaleWithdrawalReq;
import com.hhkj.admin.sale.model.res.SaleWithdrawalRes;
import com.hhkj.admin.sale.service.biz.SaleWithdrawalBizService;
import com.ruoyi.common.annotation.PermissionPrefix;
import com.ruoyi.common.base.biz.controller.v2.BaseController;
import com.ruoyi.common.utils.excl.utils.ExcelUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/sale/withdrawal")
@PermissionPrefix(value = PermissionPrefix.NO_PERMISSION)
public class SaleWithdrawalController extends BaseController<SaleWithdrawal, SaleWithdrawalReq, SaleWithdrawalRes, SaleWithdrawalBizService> {

    @PostMapping("/export")
    public void export(@RequestBody SaleWithdrawalReq saleWithdrawalReq, HttpServletResponse response) {
        ExcelUtils.downLoadExcel(SaleWithdrawalConst.EXPORT_EXCEL_TITLE, response, this.getBizService().createExportWorkbook(saleWithdrawalReq));
    }
}
